{extend name="base/frame" /}
{block name="title"}新增{/block}
{block name="main"}
<form action="" method="post" class="layui-form">
    <input type="hidden" id="pic" name="pic" value="{$info['pic']|default=''}">
    <div class="layui-form-item">
        <label class="layui-form-label">电话</label>
        <div class="layui-input-inline">
            <input type="text" name="tel" value="{$info['tel']|default=''}"  class="layui-input" required>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">学校</label>
        <div class="layui-input-inline">
            <input type="text" name="school" value="{$info['school']|default=''}"  class="layui-input" required>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">班级</label>
        <div class="layui-input-inline">
            <input type="text" name="clazz" value="{$info['clazz']|default=''}"  class="layui-input" required>
        </div>
    </div>

    <button id="submit" class="layui-btn" style="margin-left: 110px;">确定</button>
</form>

{/block}
{block name="script"}
<script>
    var resurl="{$resurl}";
    var uploadInst = layui.upload.render({
        elem: '#upload_btn'
        , url: '/admin/index/upload?dir=article'
        , done: function (res) {
            var pic=res.result
            //上传成功
            if (res.error_code == 0) {
                $('#pic').val(pic);
                $("#pic_pic").html("<img src='" + resurl + pic + "?x-oss-process=image/resize,m_fill,h_40,w_40'/>")
            }
            if (res.error_code > 0) {
                return layer.msg('上传失败');
            }
        }
        , error: function () {

        }
    });
</script>
{/block}